Add ability to use a lua library compiled as C++ #604
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is for my (admittedly specific) use case, but also an option that might be good to have.
It is rarely the case, as all the system packaged lua libraries I know of are compiled as C, but for an in-project compiled lua it can happen; since it allows for exceptions to work properly through the lua interface.
In the current master, the
extern "C"
would result in linking errors (undefined references for every single lua function).Set to OFF by default to keep compatibility.
I'm using RmlUi alongside sol2, which combines nicely, but I prefer having all the safeties enabled - including exceptions. This is the only thing (alongside a dummy FindLua.cmake for some reason, otherwise RmlUi uses the system library) needed to make it work.
Let me know if this is a bad change or if there are naming conventions you'd want fixed.
I also noticed the cmake branch, don't really know where to PR this. But it's not hard to port over, so master it is.